//
//  GQAccountViewController.m
//  MyMusic
//
//  Created by sunny on 16/4/2.
//  Copyright © 2016年 sunny. All rights reserved.
//

#import "GQAccountViewController.h"
#import "GQAccountHeaderView.h"
@interface GQAccountViewController ()

@end

@implementation GQAccountViewController

+ (instancetype)accountViewController
{
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"GQAccountViewController" bundle:nil];
    return [storyboard instantiateInitialViewController];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"账号";
    self.tableView.sectionFooterHeight = 10;
    self.tableView.sectionHeaderHeight = 10;
    
//    设置导航条上的内容
    [self setupNav];
    
//    设置头部视图
    [self setuoHeaderview];
    
}

#pragma mark - 设置导航条的内容
- (void)setupNav
{
    //    设置右边的button
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem addButtonWithImage:[UIImage imageNamed:@"cm2_topbar_icn_playing"] highlightedfImage:[UIImage imageNamed:@"cm2_topbar_icn_playing_prs"] addTarget:self action:@selector(playing)];

//    设置导航条文字颜色
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    
}

#pragma mark - 设置头部视图
- (void)setuoHeaderview
{
    GQAccountHeaderView *header = [[[NSBundle mainBundle]loadNibNamed:@"GQAccountHeaderView" owner:nil options:nil] lastObject];
    header.gq_height = 120;
    self.tableView.tableHeaderView = header;
}

#pragma mark - 监听播放音乐按钮的点击
//播放按钮的点击
- (void)playing
{
   
    UIViewController *vc = [[UIStoryboard storyboardWithName:@"QQListTVC" bundle:nil]instantiateInitialViewController];
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}
@end
